<div class="flex ng-scope">
<div class="col-jy" style="width:350px;">
	<div class="panel form-horizontal">
		<div class="panel-body">
		<link rel="stylesheet" type="text/css" href="../core/resource/css/diy.css">
			<div class="diy-phone">
				<div class="phone-head"></div>
				<div class="phone-body">
					<div class="phone-title">申请成为代理商</div>
					<div class="phone-main">
							<img style="width:100%;position: relative" ng-src="{{tomedia(pagedata.item.regbg) || '../addons/jy_weishop/resource/images/agent-top.jpg'}}" />
								<div class="weui_cells" style='margin-top:0'>
									 <div class="fui-cell-title">
										欢迎加入<span class='text-danger'>{{pagedata.item.title}}</span>，请填写申请信息
									</div>
									<div class="weui_cell">
										<div class="weui_cell_hd"><label class="weui_label">邀请人</label></div>
										<div class="weui_cell_bd weui_cell_primary">
											<span class='text-danger'>{{pagedata.agent_name || '总店'}}</span> (请核对)
										</div>
									</div>
									<div class="weui_cell">
										<div class="weui_cell_hd"><label class="weui_label">邀请码</label></div>
										<div class="weui_cell_bd weui_cell_primary">
											<input class="weui_input" type="text" placeholder="请填写邀请码">
										</div>
									</div>
									<div class="weui_cell">
										<div class="weui_cell_hd"><label class="weui_label">姓名</label></div>
										<div class="weui_cell_bd weui_cell_primary">
											<input class="weui_input" type="text" placeholder="输入姓名内容">
										</div>
									</div>
									<div class="weui_cell">
										<div class="weui_cell_hd"><label class="weui_label">手机号</label></div>
										<div class="weui_cell_bd weui_cell_primary">
											<input class="weui_input" type="text" placeholder="输入手机号内容">
										</div>
									</div>
									<div class="weui_cell">
										<div class="weui_cell_hd"><label class="weui_label">微信号</label></div>
										<div class="weui_cell_bd weui_cell_primary">
											<input class="weui_input" type="text" placeholder="输入微信号内容">
										</div>
									</div>
								</div>
								<div class="weui_cells weui_cells_form" ng-repeat="item in pagedata.item.diyformfields">
									<div class="weui_cell"  ng-if="item.type == 1">
										<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
										<div class="weui_cell_bd weui_cell_primary">
											<input class="weui_input" type="text" ng-model="item.data" placeholder="输入{{item.title}}内容">
										</div>
									</div>	
									<div class="weui_cell" ng-if="item.type == 2">
										<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
										<div class="weui_cell_bd weui_cell_primary">
											<input class="weui_input" type="number" ng-model="item.data" placeholder="输入{{item.title}}内容">
										</div>
									</div>
									<div class="weui_cell" ng-if="item.type == 18">
									<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
									<div class="weui_cell_bd weui_cell_primary">
										<input class="weui_input" type="number" ng-model="item.data" value="{{item.data || '0.00'}}" placeholder="输入{{item.title}}内容">
									</div>
									</div>

									<div class="weui_cell" ng-if="item.type == 3">
										<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
										<div class="weui_cell_bd weui_cell_primary">
											<ul class="weui_uploader_files" ng-if="item.data">
												  <li class="weui_uploader_file" style="background-image:url({{tomedia(item.data)}})"></li>
											</ul>
											<div class="weui_uploader_input_wrp">
												 <input class="weui_uploader_input" ng-model="item.data" ng-click="up_file(item,'data','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
											</div>
										</div>
									</div>
									<div class="weui_cell" ng-if="item.type == 8">
											<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
											<div class="weui_cell_bd weui_cell_primary">
												<input class="weui_input" type="number" ng-model="item.data" placeholder="输入{{item.title}}内容">
											</div>
									</div>
									<div ng-if="item.type == 9" class="weui_cell">
											<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
											<div class="weui_cell_bd weui_cell_primary">
												<input class="weui_input" type="text" ng-model="item.data" placeholder="输入{{item.title}}内容">
											</div>
									</div>
									<div ng-if="item.type == 4" class="weui_cells_title">{{item.title}}</div>
									<div ng-if="item.type == 4" class="weui_cells weui_cells_radio2" style="padding:0">
											<label class="weui_cell weui_check_label dashed" ng-repeat="(key,value) in item.value">
												<div class="weui_cell_bd weui_cell_primary">
													<span style="float:left;width:100%">{{value.title}}</span>
												</div>
												<div class="weui_cell_ft" href="javascript:;"  ng-click="item.data=value.title;">
													<input type="radio" class="weui_check" name="radio1">
													<span class="weui_icon_checked"></span>
												</div>
											</label>
									</div>	
									<div ng-if="item.type == 5" class="weui_cells_title">{{item.title}}</div>
									<div ng-if="item.type == 5" class="weui_cells weui_cells_checkbox" style="padding:0">
											<div class="fui-cell-label" style="margin-right:0.8rem;float:left;margin-bottom:0.2rem" ng-repeat="(key,value) in item.value">
												<input type="checkbox" ng-click="duoxuans(value.title,item,'data')" class="fui fui-checkbox fui-checkbox-danger verify-checkbox" value="{{value.title}}" id="s11"> {{value.title}}
											</div>
									</div>
									<div ng-if="item.type == 6" class="weui_cells_title">{{item.title}}</div>
									<div ng-if="item.type == 6" class="weui_cells weui_cells_form" style="padding:0">
									<div class="weui_cell">
											<div class="weui_cell_bd weui_cell_primary">
												<textarea class="weui_textarea" ng-model="item.data" placeholder="请输入{{item.title}}" rows="2"></textarea>
												<div class="weui_textarea_counter"><span>0</span>/118</div>
											</div>
										</div>
									</div>
									<div ng-if="item.type == 7" class="weui_cells_title">{{item.title}}</div>
									<div ng-if="item.type == 7" class="weui_cells weui_cells_form" style="padding:0">
										<div class="weui_cell">
											<div class="fui-cell-label" style="width:33%">
												<select ng-model="item.data.province" class="form-control tpl-province">
												<option value="" selected="selected">省份</option>
												<option ng-repeat="(value,data) in pagedata.extradata.province.province" value="{{value}}" ng-selected="item.data.province==value">{{value}}</option>
												</select>
											</div>
											<div class="fui-cell-label" style="width:33%">
												<select ng-model="item.data.city" class="form-control tpl-city">
												<option value="" selected="selected">城市</option>
												<option ng-repeat="(value,data) in pagedata.extradata.province.province[item.data.province]" value="{{value}}" ng-selected="item.data.city==value">{{value}}</option>
												</select>
											</div>
											<div class="fui-cell-label" style="width:33%">
												<select ng-model="item.data.district" class="form-control tpl-district">
												<option value="" selected="selected">区县</option>
												<option ng-repeat="value in pagedata.extradata.province.province[item.data.province][item.data.city]" value="{{value}}" ng-selected="item.data.district==value">{{value}}</option>
												</select>
											</div>
										</div>
								   </div>		
							</div>
							<div class="weui_btn_area">
										<a class="weui_btn weui_btn_primary">立即提交</a>
							</div>
					</div>
				</div>
				<div class="phone-foot"></div>
			</div>
		</div>
	</div>
</div>
<div class="col-jy" style="width:100%;">
<div class="form-horizontal modal-edit">
<div class="modal-panel">
<div class="form-group">
	<label class="col-xs-12 col-sm-3 col-md-2 right-label " ng-class="{'must':false}">顶部图片</label>
	<div class="col-xs-12 col-sm-8 col-lg-9">
		<div class="input-group">
			<input type="text" ng-model="pagedata.item.regbg" ng-class="{'must_set':false}" class="form-control" autocomplete="off">
			<span class="input-group-btn">
				<button class="btn btn-gray" type="button" ng-click="image(pagedata.item,'regbg')">选择图片</button>
			</span>
			<div class="help-block " style="display:none;color:red;">请输入顶部图片</div>
		</div>
		<div class="input-group" style="margin-top:.5em;">
			<img onclick="$('#showimageregbg').modal();" ng-src="{{tomedia(pagedata.item.regbg)}}" class="img-responsive img-thumbnail" width="150">
		</div>
		<div class="help-block">宽度650，高度不限</div>		
	</div>
</div>
<div class="form-group">
	<label class="col-xs-12 col-sm-3 col-md-2 right-label ">
		输入项
	</label>
	<div class="col-xs-12 col-sm-8 col-lg-9">
	<div class="table-responsive panel-body" style="padding:0" ng-init="checkarray(pagedata.item,'diyformfields')">
			<table class="table jinyun-table table-hover vertical-middle jinyun-form">
				<thead class="navbar-inner">
					<tr>
						<th class="">标题</th><th class="">类型</th><th class="">提示语</th><th class="">*必填?</th>
						<th class="text-right " style="word-break : break-all;">操作</th>
					</tr>
				</thead>
				<tbody id="re-items">
					<tr ng-repeat="item in pagedata.item.diyformfields" class="ng-scope">
						<td>
							<div class="overflow-h ng-binding" ng-mouseover="item.showtp=1" ng-mouseleave="item.showtp=0" data-toggle="tooltip" data-field="mimetype" style="max-width:{width}px">{{item.title}}</div>
						</td>
						<td>
							<span class="label label-success liststatus{{item.type}}">{{pagedata.item.types[item.type] || '无'}}</span>
						</td>
						<td>
							<div class="overflow-h" ng-mouseover="item.showtp=1" ng-mouseleave="item.showtp=0" data-toggle="tooltip" data-field="mimetype" style="max-width:{width}px">{{item.placeholder}}</div>
						</td>
						<td>
							<label style="padding-top:10px">
								<div ng-if="item.ismust==1" class="switch switchOn"></div>
								<div ng-if="item.ismust!=1" class="switch"></div>
							</label>
						</td>
						<td class="text-right">
							<!-- ngIf: $index>0 -->
							<a href="javascript:;" title="编辑" ng-click="func.detail_diyformfields(item)" class="btn btn-primary btn-sm"><i class="fa fa-edit"></i></a>
							<a href="javascript:;" ng-click="pagedata.item.diyformfields.splice($index,1)" title="删除此条目" class="btn btn-danger btn-sm"><i class="fa fa-times"></i></a> &nbsp;
						</td>
					</tr>
					<tr>
						<td colspan="805" class="text-left">
							<a class="color-gray add-new-keyword" href="javascript:;" ng-click="newfield={};i=pagedata.item.diyformfields.push(newfield);func.detail_diyformfields(pagedata.item.diyformfields[i-1])">
								<span class="add-icon"><i class="fa fa-plus"></i></span>
								<span class="text ">添加自定义表单项</span>
							</a>
						</td>
					</tr>
				</tbody>
			</table>
	</div>
	</div>
</div>
<div id="floating-content-diyformfields" ng-init="pagedata.current_field={}" class="modal fade" data-cs="xxx" tabindex="-1" style="z-index:1039;display:none">
    <div class="jinyun-modal-dialog modal-dialog" style="width: 920px;">
        <div class="modal-content">
            <div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button><h3>设置详细信息</h3></div>
			<div class="modal-body form-horizontal">
				<div  class="form-group ng-scope">
					<label class="col-xs-12 col-sm-3 col-md-2 right-label " ng-class="{'must':false}">标题</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<input type="text" class="form-control  ng-pristine ng-untouched ng-valid ng-empty" ng-class="{'must_set':false}" onblur="if($(this).hasClass('must_set') &amp;&amp; $(this).val()==''){$(this).next().show();$(this).css('border-color','red')}else{$(this).next().hide();$(this).css('border-color','#ddd')}" ng-model="pagedata.current_field.title" ng-readonly="false">
						<div class="help-block " style="display:none;color:red;">请输入标题</div>
						<div class="help-block"></div>
					</div>
				</div>
				<div  class="form-group ng-scope">
							<label class="col-xs-12 col-sm-3 col-md-2 right-label " ng-class="{'must':false}">类型</label>
							<div class="col-xs-12 col-sm-8 col-lg-9">
								<div ng-style="{'background-color':ifelse(false,'#f7f7f7','')}">
								<div class="radio radio-inline ng-scope" ng-repeat="(value,dtitle) in pagedata.types">
									<label class="">
										<input type="radio" value="{{value}}" ng-model="pagedata.current_field.type" ng-disabled="false" name="{{value}}">{{dtitle}}
									</label>
								</div>
								</div>
								<div class="help-block"></div>
							</div>
				</div>
				<div ng-show="check_show(pagedata.current_field,{'type':[4,5]})" class="ng-hide">
					<div class="table-responsive" ng-class="{'panel-body':''}" ng-init="checkarray(pagedata.current_field,'value')">
							<table class="table jinyun-table table-hover vertical-middle jinyun-form">
								<thead>
									<tr>
										<th ng-repeat="th in [{'type':'string','name':'title','title':'选项名称','help':''}]" style="word-break : break-all;" class=" ng-scope">选项名称</th>
										<th ng-if="false==false &amp;&amp; false==false" class="text-right ng-scope" style="word-break : break-all;">操作</th>
									</tr>
								</thead>
								<tbody id="re-items">
									<tr ng-if="false==false &amp;&amp; false==false" class="ng-scope">
										<td class="text-left">
											<a class="color-gray add-new-keyword" href="javascript:;" ng-click="checkarray(pagedata.current_field,'value');newfield={};pagedata.current_field.value.push(newfield);">
												<span class="add-icon"><i class="fa fa-plus"></i></span>
												<span class="text">添加自定义表单项</span>
											</a>
										</td>
									</tr>
								</tbody>
							</table>
					</div>

				</div>

		<div class="form-group ng-scope">
			<label class="col-xs-12 col-sm-3 col-md-2 right-label " ng-class="{'must':false}">提示语</label>
			<div class="col-xs-12 col-sm-8 col-lg-9">
				<input type="text" class="form-control  ng-pristine ng-untouched ng-valid ng-empty" ng-class="{'must_set':false}" onblur="if($(this).hasClass('must_set') &amp;&amp; $(this).val()==''){$(this).next().show();$(this).css('border-color','red')}else{$(this).next().hide();$(this).css('border-color','#ddd')}" ng-model="pagedata.current_field.placeholder" ng-readonly="false">
				<div class="help-block " style="display:none;color:red;">请输入提示语</div>
				<div class="help-block"></div>
			</div>
		</div>	
		<div class="form-group">
						<label class="col-xs-12 col-sm-3 col-md-2 right-label " ng-class="{'must':false}">*必填?</label>
						<div class="col-xs-12 col-sm-8 col-lg-9">
							<label class="right-label">
								<div ng-show="pagedata.current_field.ismust==1" class="switch switchOn ng-hide" ng-click="pagedata.current_field.ismust=0"></div>
								<div ng-show="pagedata.current_field.ismust!=1" class="switch" ng-click="pagedata.current_field.ismust=1"></div>
							</label>
							<div class="help-block"></div>
						</div>
					</div>
			</div>
            <div class="modal-footer"><a class="btn btn-primary " ng-click="func.detail_submit_diyformfields()">完成</a></div>
        </div>
    </div>
</div>
<script>
window.scope.func.detail_diyformfields=function(item){
	window.scope.pagedata.current_field=item;
	//var cs=$('#floating-content-diyformfields').attr('data-cs');
	//alert(cs);
	window.bootstrap('#floating-content-diyformfields').modal();
}
window.scope.func.detail_submit_diyformfields=function(){
	window.scope.check_form('floating-content-diyformfields');
	window.bootstrap('#floating-content-diyformfields').modal('hide');
}

</script>
</div>
</div>
<div class="modal-sub"><!-- ngIf: false --><button class="btn btn-primary " ng-click="check_form();post(pagedata.item,'get')">提交</button></div></div></div>